package com.houmeiyuan.huiguniang.modles.dao;

import com.houmeiyuan.huiguniang.modles.domain.WxUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;

@Repository
@Transactional
@Mapper
public interface UserDao {
    Integer registerByWX(WxUser user);

    //@Select("select * from WxUser where openid = #{openId}")

   WxUser selectByOpenId(@Param("openId") String openId);

   //update WxUser set password=#{password},updateTime = NOW() where phone=#{phone}

   int updatePassword(Map<String,Object> map);

    //update wxuser set phone=#{newphone},updateTime = NOW() where phone=#{oldphone}

    int updatePhone(Map<String,Object> map);

    /*select * from WxUser where  phone = #{phone}*/

   WxUser selectByphone(@Param("phone")String phone);

  /*  insert into wxuser (openId,createTime,updateTime)values(#{openId},#{createTime},#{updateTime})*/
   Integer addWxUser(Map<String,Object> mp);


}
